/**
    服务物品管理 组件
**/
(function (vc) {

    vc.extends({
        propTypes: {
            callBackListener: vc.propTypes.string, //父组件名称
            callBackFunction: vc.propTypes.string //父组件监听方法
        },
        data: {
            viewHousekeepingResourceInfo: {
                index: 0,
                flowComponent: 'viewHousekeepingResourceInfo',
                resTypeId: '',
                resTypeName: '',
                resName: '',
                resCode: '',
                costPrice: '',
                price: '',
                stock: '',
                supplierId: '',
                supplierName: '',
                remark: '',

            }
        },
        _initMethod: function () {
            //根据请求参数查询 查询 业主信息
            $that._loadHousekeepingResourceInfoData();
        },
        _initEvent: function () {
            vc.on('viewHousekeepingResourceInfo', 'chooseHousekeepingResource', function (_app) {
                vc.copyObject(_app, $that.viewHousekeepingResourceInfo);
                vc.emit($props.callBackListener, $props.callBackFunction, $that.viewHousekeepingResourceInfo);
            });

            vc.on('viewHousekeepingResourceInfo', 'onIndex', function (_index) {
                $that.viewHousekeepingResourceInfo.index = _index;
            });

        },
        methods: {

            _openSelectHousekeepingResourceInfoModel() {
                vc.emit('chooseHousekeepingResource', 'openChooseHousekeepingResourceModel', {});
            },
            _openAddHousekeepingResourceInfoModel() {
                vc.emit('addHousekeepingResource', 'openAddHousekeepingResourceModal', {});
            },
            _loadHousekeepingResourceInfoData: function () {

            }
        }
    });

})(window.vc);
